package org.example.thread;

import java.util.concurrent.locks.ReentrantLock;

public class A {

    private volatile int a;

    private final ReentrantLock lock = new ReentrantLock();

    public void pushA(){
        lock.lock();
        a++;
        lock.unlock();
        // to do something
    }

    public int getA() {
        return a;
    }
}
